#import "dfhgwhruebvhrheystallsecurity.h"
#import "dfhgwhruebvhrheyprofessionalincidentally.h"
#import "dfhgwhruebvhrheyfacultyauto.h"
@interface dfhgwhruebvhrheyfacultyauto ()
@property (nonatomic, strong) dfhgwhruebvhrheystallsecurity *couponView;
@end
@implementation dfhgwhruebvhrheyfacultyauto
- (void)awakeFromNib {
    [super awakeFromNib];
	self.couponView = [[NSBundle mainBundle] loadNibNamed:@"dfhgwhruebvhrheystallsecurity" owner:nil options:nil].firstObject;
	self.couponView.radius = 8;
    self.couponView.cornerRadius = 10;
    self.couponView.vlineToTopHeight = 60;
	self.couponView.userInteractionEnabled = NO;
	[self.contentView addSubview:self.couponView];
	[self.couponView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.bottom.equalTo(self.contentView).offset(-15).priorityMedium();
		make.left.equalTo(self.contentView).offset(13);
		make.top.centerX.equalTo(self.contentView);
		make.height.mas_equalTo(90);
	}];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}
- (NSString *)formatterDate:(NSTimeInterval)time {
	NSDate *date = [NSDate dateWithTimeIntervalSince1970:time];
	NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
	formatter.dateFormat = @"MM.dd.yyyy";
	return [formatter stringFromDate:date];
}
- (void)bindData:(PPP_CouponItemModel *)model {
    self.couponView.inCouponListView = self.inView;
    self.couponView.coupon = model;
    self.couponView.money = [NSString stringWithFormat:@"%d", model.arch_money];
    self.couponView.dateString = [NSString stringWithFormat:@"Vaid date untill：%@", [self formatterDate:model.invalid_time]];
}
@end
